#include <iostream>
#include <sstream>
#include <iomanip>
#include <fstream>
#include "Item.h"
#include "Shelf.h"
#include "Cart.h"
#include "Daily.h"
#include "Toy.h"
#include "Food.h"

void display(Shslf *,Cart*);//展示当前货架和购物车情况
void init(Shelf *); //从文本文件初始化货架上的商品
int addIntoCart(Shelf *,Cart *,std::string strItemName); //通过名字执行加购函数，成功将返回0

void display(Shelf *shelf,Cart *cart){
	std::cout<<std::endl<<"--------------------------------"<<std::endl;
	std::cout<<"##货架##"<<std::endl;
	//
	for(){
	}


}

void init(Shelf *){ //从文本文件初始化货架上的商品

}
int addIntoCart(Shelf *,Cart *,std::string strItemName){ //通过名字执行加购函数，成功将返回0

}

int main(){

	Shelf *shelf = new Shelf;   	
	Cart *cart = new Cart(shelf);
	std::cout<<"欢迎来到无人售货超市，输入商品加购，输入EXIT退出"<<endl;
	init(shelf);
	display(shelf,cart);
	std::cout<<":";

	//
	std::string strItemName;
	std::cin>>strItemName;
	while(0!=strItemName.compare("exit")){
		//
		if(0!=addIntoCart(shelf,cart,strItemName)){
			//
			display(shelf,cart);
			std::cout<<"输入有误或存货不足，请重新输入";
		}else{
			//
			display(shelf,cart);
			std::cout<<"架构成功，请继续输入";
		}
		std::cout<<":";
		std::cin>>strItemName; //
	}
	return 0;
}
